package cz.khfotbal.domain;

import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="SEASON_COMPETION_TEAM_PLAYER")
public class SeasonCompetionTeamPlayer {

	@Id
	@GeneratedValue
	private int id;
	
	private String position;
	
	private int squadNr;
	
	@OneToMany(mappedBy="seasonCompetionTeamPlayer", cascade=CascadeType.ALL, fetch=FetchType.EAGER)
	private Set<Event> events;
	
	@ManyToOne
	@JoinColumn(name="PLAYER_ID")
	private Player player;
	
	@ManyToOne
	@JoinColumn(name="SEASON_COMPETION_TEAM_ID")
	private SeasonCompetionTeam seasonCompetionTeam;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public int getSquadNr() {
		return squadNr;
	}

	public void setSquadNr(int squadNr) {
		this.squadNr = squadNr;
	}

	public Set<Event> getEvents() {
		return events;
	}

	public void setEvents(Set<Event> events) {
		this.events = events;
	}

	public Player getPlayer() {
		return player;
	}

	public void setPlayer(Player player) {
		this.player = player;
	}

	public SeasonCompetionTeam getSeasonCompetionTeam() {
		return seasonCompetionTeam;
	}

	public void setSeasonCompetionTeam(SeasonCompetionTeam seasonCompetionTeam) {
		this.seasonCompetionTeam = seasonCompetionTeam;
	}
	
	
	
}
